package com.videoweb.mapper;

import com.videoweb.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lmr
 * @since 2025-05-17
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {

    public List<String> selectMenuPermsByRoleId(Long roleId);

    public List<String> selectMenuPermsByUserId(Long userId);



//    构建动态路由部分：
    public List<Menu> selectMenuTreeByUserId(Long userId);

    List<Long> selectMenuIdsByRoleId(Long roleId);

    void deleteRoleMenusByRoleId(Long roleId);
    void insertRoleMenusBatch(@Param("roleId") Long roleId, @Param("menuIds") List<Integer> menuIds);

}
